/* Ejercicio 3.27
   ejer3_27.c */
#include <stdio.h>

/* funcion main, el programa inicia aca */
int main( void )
{
    int counter, number, largest, second, aux;

    printf( "Enter a number: " );
    scanf( "%d", &number );
    largest = number;
    printf( "Enter a number: " );
    scanf( "%d", &number );

    if ( number > largest ) {
        second = largest;
        largest = number;
    }
    else {
        second = number;
    }

    counter = 3;
    while ( counter <= 10 ) {
        printf( "Enter a number: " );
        scanf( "%d", &number );

        if ( number > second ) {
            second = number;

            if ( second > largest ) {
                aux = largest;
                largest = second;
                second = aux;
            }
        }

        counter = counter + 1;
    }

    printf( "The largest value is: %d\n", largest );
    printf( "The second largest value is: %d\n", second );
	return 0;
} /* fin de la funcion main */
